package com.py.credit.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.py.credit.entity.Template;
import com.py.credit.entity.TemplateDetailData;
import com.py.framework.core.common.Page;

public interface TemplateDao {

	/**
	 * 获取模板列表
	 * 
	 * @return
	 */
	public List<Map<String, Object>> selectByConditionForPage(@Param(value = "columns") List<String> columns,
			@Param(value = "additionalColumns") String[] additionalColumns,
			@Param(value = "conditions") List<String> conditions, @Param(value = "page") Page page);

	public List<Map<String, Object>> selectMbCode();

	public int selectSameName(@Param(value = "id") String id, @Param(value = "name") String name);

	public void addTemplate(@Param(value = "name") String name, @Param(value = "content") String content,
			@Param(value = "type") String type, @Param(value = "managerId") int managerId,
			@Param(value = "start_time") String start_time, @Param(value = "end_time") String end_time);

	void del(@Param(value = "ids") List<String> ids);

	public void modify(@Param(value = "id") String id, @Param(value = "name") String name,
			@Param(value = "content") String content, @Param(value = "start_time") String start_time,
			@Param(value = "end_time") String end_time);

	public Map<String, String> selectTemplateData(@Param(value = "start_time") String start_time,
			@Param(value = "end_time") String end_time);

	public int selectDeptGovernmentnum(@Param(value = "start_time") String start_time,
			@Param(value = "end_time") String end_time);

	public int selectAssociationnum(@Param(value = "start_time") String start_time,
			@Param(value = "end_time") String end_time);

	public int selectMechanismnum(@Param(value = "start_time") String start_time,
			@Param(value = "end_time") String end_time);

	public int insertTemplateData(@Param(value = "submit_num") String submit_num,
			@Param(value = "warehous_num") String warehous_num,
			@Param(value = "warehous_proportion") String warehous_proportion,
			@Param(value = "dept_num") String dept_num, @Param(value = "dept_government_num") int dept_government_num,
			@Param(value = "dept_association_num") int dept_association_num,
			@Param(value = "dept_mechanism_num") int dept_mechanism_num, @Param(value = "m_id") int m_id);

	public List<TemplateDetailData> selectTemplateDetailData(@Param(value = "start_time") String start_time,
			@Param(value = "end_time") String end_time);

	public void insertTemplateDetailData(@Param(value = "region_name") String region_name,
			@Param(value = "dept_top_name") String dept_top_name, @Param(value = "table_name") String table_name,
			@Param(value = "dept_name") String dept_name, @Param(value = "total_num") int total_num,
			@Param(value = "success_num") int success_num, @Param(value = "error_num") int error_num,
			@Param(value = "success_proportion") String success_proportion, @Param(value = "id") int id);

	public int selectSameType(@Param(value = "type") String type);

	public Template selectOne(@Param(value = "id") int id);

	public void startEnable(@Param(value = "id") int id);

}
